package com.achen.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class TestController {
    @RequestMapping("code")
    public String code(Model model){
        model.addAttribute("msg", "明天要上课！");
        return "hello";
    }

   @RequestMapping("code2")
    public ModelAndView code2(){
    ModelAndView modelAndView = new ModelAndView();
    modelAndView.addObject("msg","明天不想上课！");
    modelAndView.setViewName("hello");
    return modelAndView;
}


}